<template>
  <div id="students-score"></div>
</template>

<script>
import echarts from '../../lib/echarts'
import macarons from 'echarts/theme/macarons'

export default {
  name: "DataAnalyzeGrade",
  components: {},
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
    this.getStudentsScore()
  },
  methods: {
    getStudentsScore() {
      var myChart = echarts.init(document.getElementById('students-score'), 'macarons');

      var option = {
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        grid: {
          left: "4%",
          right: "4%",
          top: "10%",
          bottom: "5%",
          containLabel: true
        },
        legend: {
          data: ['精力状态', '学习状态', '情绪状态', '成绩']
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              show: false
            },
            axisLabel: {
              show: true,
              textStyle: {
                color: "#2479ff",
                lineHeight: 26
              }
            },
            axisLine: {
              show: true,
              lineStyle: {
                color: '#2479ff',
                width: 1,
                type: "solid"
              }
            },
            data: ['张婷', '张艾嘉', '张曼玉', '张大山', '张敬轩', '张佑赫', '张铁林']
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLabel: {
              show: true,
              textStyle: {
                color: "#2479ff",
              }
            },
            axisLine: {
              show: true,
              lineStyle: {
                color: '#2479ff',
                width: 1,
                type: "solid"
              }
            },
          }
        ],
        series: [
          {
            name: '精力状态',
            type: 'bar',
            barGap: 0,
            data: [320, 332, 301, 334, 390, 100, 200]
          },
          {
            name: '学习状态',
            type: 'bar',
            data: [220, 182, 191, 234, 290, 130, 200]
          },
          {
            name: '情绪状态',
            type: 'bar',
            data: [150, 232, 201, 154, 190, 100, 230]
          },
          {
            name: '成绩',
            type: 'bar',
            data: [98, 77, 101, 99, 40, 100, 200]
          }
        ]
      };

      myChart.setOption(option)
    }
  }
}
</script>

<style scoped>
#students-score {
  width: 100%;
  height: 100%;
}
</style>
